package com.xbts.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xbts.system.mapper.CnContractOrderItemRelationMapper;
import com.xbts.system.domain.CnContractOrderItemRelation;
import com.xbts.system.service.ICnContractOrderItemRelationService;

/**
 * 合同订单关联Service业务层处理
 * 
 * @author xbts
 * @date 2023-08-31
 */
@Service
public class CnContractOrderItemRelationServiceImpl  extends ServiceImpl<CnContractOrderItemRelationMapper, CnContractOrderItemRelation> implements ICnContractOrderItemRelationService {

    /**
     * 查询合同订单关联列表
     *
     * @param cnContractOrderItemRelation 合同订单关联
     * @return 合同订单关联
     */
    @Override
    public List<CnContractOrderItemRelation> selectCnContractOrderItemRelationList(CnContractOrderItemRelation cnContractOrderItemRelation) {
        QueryWrapper<CnContractOrderItemRelation> queryWrapper = new QueryWrapper<>();
        return list(queryWrapper);
    }

    /**
     * 查询合同订单关联
     *
     * @param id 合同订单关联主键
     * @return 合同订单关联
     */
    @Override
    public CnContractOrderItemRelation selectCnContractOrderItemRelationById(String id) {
        return getById(id);
    }

    /**
     * 新增合同订单关联
     *
     * @param cnContractOrderItemRelation 合同订单关联
     * @return 结果
     */
    @Override
    public boolean insertCnContractOrderItemRelation(CnContractOrderItemRelation cnContractOrderItemRelation) {
        return save(cnContractOrderItemRelation);
    }

    /**
     * 修改合同订单关联
     *
     * @param cnContractOrderItemRelation 合同订单关联
     * @return 结果
     */
    @Override
    public boolean updateCnContractOrderItemRelation(CnContractOrderItemRelation cnContractOrderItemRelation) {
        return updateById(cnContractOrderItemRelation);
    }

    /**
     * 批量删除合同订单关联
     *
     * @param ids 需要删除的合同订单关联主键
     * @return 结果
     */
    @Override
    public boolean deleteCnContractOrderItemRelationByIds(List<String> ids) {
        return removeBatchByIds(ids);
    }

    /**
     * 删除合同订单关联信息
     *
     * @param id 合同订单关联主键
     * @return 结果
     */
    @Transactional
    @Override
    public boolean deleteCnContractOrderItemRelationById(String id) {
      return removeById(id);
    }

}
